import request from '@/util/http.js'

const API = `/basic/category`;



export function queryCategoryAll(){
    return request({
        method: 'GET',
        url: `${API}/query `
    })
}

export function queryById(pid){
    return request({
        method: 'GET',
        url: `${API}/queryById`,
        params: {
            pid
        }
    })
}

export function deleteCategoryById(id) {
    return request({
        method: 'Delete',
        url: `${API}/${id}`
    })
}

export function saveCategory(obj) {
    return request({
        method: 'post',
        url: `${API}/save`,
        data: obj
    })
}

export function updateCategory(obj) {
    return request({
        method: 'put',
        url: `${API}/update`,
        data: obj
    })
}

export function getLevel1(){
    return request({
        url: `${API}/get/level1`
    })
}